import request from './config/request'
import { ApiResponse } from './type'

export interface PostData {
  id: number,
  title: string, // 标题
  content?: string, // 内容
  lookCount: number, // 查看数
  likeCount: number, // 喜欢数
  collectCount: number, // 收藏数
  categoryId:string, // 分类描述id
  tagIds:number[], // 标签描述id[]
  createdAt?: string,
  imgUrl?:string,
  updatedAt?:string
}
export interface PostList {
  posts: PostData[];
  total: number;
}
// 获取全部文章分页
export const getPost = (data): Promise<ApiResponse<PostList>> => {
  return request.post('/post/find', data)
}
